/*
 * @lc app=leetcode id=162 lang=cpp
 *
 * [162] Find Peak Element
 */
class Solution {
public:
    int findPeakElement(vector<int>& nums) {
        int len = nums.size();
        for (int i=0; i<len-1; i++) {
            if (nums[i] > nums[i+1]) {
                return i;
            }
        }
        return len-1;
    }
};

